package com.shop.cereshop.app.service.shop.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.shop.cereshop.app.dao.shop.CereShopLogoTitleDAO;
import com.shop.cereshop.app.service.shop.CereShopLogoTitleService;
import com.shop.cereshop.commons.domain.shop.CereShopLogoTitle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 店铺头像标题Service实现
 */
@Service
public class CereShopLogoTitleServiceImpl implements CereShopLogoTitleService {

    @Autowired
    private CereShopLogoTitleDAO cereShopLogoTitleDAO;

    @Override
    public CereShopLogoTitle getByShopIdAndType(Long shopId, Integer type) {
        if (shopId == null || type == null) {
            return null;
        }
        LambdaQueryWrapper<CereShopLogoTitle> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(CereShopLogoTitle::getShopId, shopId);
        wrapper.eq(CereShopLogoTitle::getType, type);
        return cereShopLogoTitleDAO.selectOne(wrapper);
    }
}

